Skip to content

feat(install): generate routing config with URL strategy support#7

Merged
anilcancakir merged 2 commits intomasterfrom
feat/routing-config
Apr 7, 2026
Merged

feat(install): generate routing config with URL strategy support#7
anilcancakir merged 2 commits intomasterfrom
feat/routing-config

Conversation

@anilcancakir
Copy link
Copy Markdown
Contributor

Summary

Adds config/routing.dart generation to magic install — supports the new URL strategy feature from fluttersdk/magic#40.

  • New routing_config.stub template with url_strategy: null default
  • InstallStubs.routingConfigContent() method
  • Always generated (like app.dart and view.dart) — no --without-routing flag needed since default is a no-op
  • Import and factory added to generated main.dart

Test plan

  • dart analyze — zero warnings
  • magic install in a fresh Flutter project generates lib/config/routing.dart
  • Generated main.dart includes routing config import and factory

Copilot AI review requested due to automatic review settings April 7, 2026 00:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new always-generated lib/config/routing.dart during magic install to support URL strategy configuration (e.g., switching Flutter web URLs from hash to path strategy), and wires it into the generated main.dart bootstrap.

Changes:

  • Add a new install stub (assets/stubs/install/routing_config.stub) and expose it via InstallStubs.routingConfigContent().
  • Ensure magic install always generates lib/config/routing.dart.
  • Include the new routing config import + factory in generated lib/main.dart.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Documents the new generated routing.dart config file in the project tree.
lib/src/stubs/install_stubs.dart Adds a stub loader method for routing config content.
lib/src/commands/install_command.dart Writes routing.dart on install and injects it into main.dart config imports/factories.
CLAUDE.md Updates documented stub counts to reflect the current repository state.
CHANGELOG.md Adds an Unreleased entry describing the new routing config generation.
assets/stubs/install/routing_config.stub New template for lib/config/routing.dart with url_strategy defaulting to null.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sentry
Copy link
Copy Markdown

sentry bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@anilcancakir anilcancakir merged commit 112a871 into master Apr 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants